
public class file_and_rank implements Comparable
{
  
	public String file_name="";
	public int rank;
	public double score;
	
	public file_and_rank(String file_name, int rank,double score)
	{
		this.file_name =  file_name;
		this.rank =  rank;
		this.score =  score;
	}
	
	
	public String getFile_name()
	{
		return this.file_name;
	}
	public int getRank()
	{
		return this.rank;
	}
	
	public double getScore()
	{
		return this.score;
	}
	
	public int compareTo(Object other_obj){
	       
		//System.out.println("TYPE="+other_obj.getClass());
        if(!(other_obj instanceof file_and_rank)){
            throw new ClassCastException("Not a valid Car object!!");
        }
       
        file_and_rank tempObj = (file_and_rank)other_obj;
       
        if(this.getRank() > tempObj.getRank()){
            return 1;
            
        }else if(this.getRank() < tempObj.getRank()){
            return -1;
        }else{
            return 0;
        }
    }
}
